package simmar.xcs;

public interface XCSConfig
{
    public static enum DEBUG_LEVEL
    {
        SILENT, NORMAL, VERBOSE
    }; 
    
    public static enum MODE
    {
        RUN, LEARN, TEST
    };    
    
    public static enum ObservationType 
    { 
    	LEVEL, ENEMIES, MERGED 
    };
    
    public static DEBUG_LEVEL XCS_DEBUG_LEVEL = DEBUG_LEVEL.SILENT;
//    public static final DEBUG_LEVEL XCS_DEBUG_LEVEL = DEBUG_LEVEL.NORMAL;
//    public static final DEBUG_LEVEL XCS_DEBUG_LEVEL = DEBUG_LEVEL.VERBOSE;
    
//    public static final MODE XCS_MODE = MODE.RUN; 
    public static final MODE XCS_MODE = MODE.LEARN;
//    public static final MODE XCS_MODE = MODE.TEST;
        
    public static final boolean[][] MARIO_ACTIONS = 
    {
//      {false, false, false, false, false, false},  // No action
        {false, true, false, false, false, false},  // Right
        {false, true, false, true, false, false},   // Right + Jump
        {false, true, false, false, true, false},   // Right + Speed
        {false, true, false, true, true, false},    // Right + Jump + Speed
//        {true, false, false, false, false, false},  // Left
//        {true, false, false, true, false, false},   // Left + Jump
//        {true, false, false, false, true, false},   // Left + Speed
//        {true, false, false, true, true, false},    // Left + Jump + Speed
//        {false, false, false, true, false, false},  // Jump
//      {false, false, true, false, false, false},  // Down
//      {false, false, false, false, false, true}   // Up  
    };
    
    public static enum Action 
    { 
//        NO_ACTION,
        RIGHT,
        RIGHT_JUMP,
        RIGHT_SPEED,
        RIGHT_JUMP_SPEED,
//        LEFT,
//        LEFT_JUMP,
//        LEFT_SPEED,
//        LEFT_JUMP_SPEED,
//        JUMP,        
//        UP,
//        DOWN,  
        UNDEFINED
    };
    
    public static enum Condition 
    {
        CAN_ASCEND,
        OBSTACLE_AHEAD,
        PIT_AHEAD,
//        DANGER_BELOW,
        SHOT_AIMED,
        ENEMY_AHEAD,
        UNDEFINED
    };

    public static final long EVALUATION_QUOTA = 250;
    
    // CLASSIFIER CONSTANTS
    public static final int CONDITION_SIZE = Condition.UNDEFINED.ordinal();
    public static final float INITIAL_PREDICTION = 1.0e-6f;
    public static final float INITIAL_ACCURACY = 1.0e-6f;
    public static final float INITIAL_FITNESS = 1.0e-6f;
//    public static final float INITIAL_PREDICTION = 0.0f;
//    public static final float INITIAL_ACCURACY = 0.0f;
//    public static final float INITIAL_FITNESS = 0.0f;
    
    // GENERAL XCS CONSTANTS 
    public static final int CLASSIFIER_POPULATION_SIZE = 400;
    
    // PERFORMANCE COMPONENT CONSTANTS    
    public static final float EXPLORATION_PROBABILITY = 0.5f;
    public static final float COVERING_THRESHOLD = MARIO_ACTIONS.length;
    public static final float WILDCARD_PROBABILITY = 0.33f;
    public static final float LEARNING_RATE = 0.2f;
    public static final float DISCOUNT_FACTOR = 0.9f;
    public static final float ACCURACY_DISTINCTION_RATE = 0.1f;
    public static final int FITNESS_UPDATE_POWER = 5;
    
    // REINFORCEMENT COMPONENT CONSTANTS
    public static final float ACCURACY_THRESHOLD = 10.0f; // MAKE ONE PERCENT OF MAXIMUM REWARD
    
    // DISOVERY COMPONENT CONSTANTS
    public static final int GA_FIRING_INTERVAL = 25;
    public static final float CROSSOVER_PROBABILITY = 0.8f;
    public static final float MUTATION_PROBABILITY = 0.02f;
    public static final boolean DO_GA_SUBSUMPTION = false;
    public static final boolean DO_ACTION_SET_SUBSUMPTION = false;
    public static final int SUBSUMPTION_THRESHOLD = 20;
    public static final int DELETION_THRESHOLD = 20;
    public static final float FITNESS_FRACTION_FOR_DELETION = 0.1f;
}

//{false, false, false, false, false, false},  // No action
//{true, false, false, false, false, false},  // Left
//{true, false, false, true, false, false},   // Left + Jump
//{true, false, false, true, true, false},    // Left + Jump + Speed
//{true, false, false, false, true, false},   // Left + Speed
//{false, true, false, false, false, false},  // Right
//{false, true, false, true, false, false},   // Right + Jump
//{false, true, false, true, true, false},    // Right + Jump + Speed
//{false, true, false, false, true, false},   // Right + Speed
//{false, false, true, false, false, false},  // Down
//{false, false, false, true, false, false},  // Jump
//{false, false, false, false, false, true}   // Up       

